<?php

/**
 * MfgPno form base class.
 *
 * @method MfgPno getObject() Returns the current form's model object
 *
 * @package    tinystockmis
 * @subpackage form
 * @author     Linfeng Wu
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseMfgPnoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'acct_set_id' => new sfWidgetFormInputText(),
      'pno_no'      => new sfWidgetFormInputText(),
      'pno_name'    => new sfWidgetFormInputText(),
      'pno_desc'    => new sfWidgetFormInputText(),
      'pno_fdesc'   => new sfWidgetFormTextarea(),
      'pno_uq'      => new sfWidgetFormInputText(),
      'pno_minorq'  => new sfWidgetFormInputText(),
      'pno_maxorq'  => new sfWidgetFormInputText(),
      'pno_orq'     => new sfWidgetFormInputText(),
      'pno_src'     => new sfWidgetFormInputText(),
      'pno_abc'     => new sfWidgetFormChoice(array('choices' => array('a' => 'a', 'b' => 'b', 'c' => 'c'))),
      'pno_sfq'     => new sfWidgetFormInputText(),
      'pno_rop'     => new sfWidgetFormInputText(),
      'pno_eoq'     => new sfWidgetFormInputText(),
      'pno_pp'      => new sfWidgetFormChoice(array('choices' => array('mrp' => 'mrp', 'rop' => 'rop', 'oth' => 'oth'))),
      'pno_bom'     => new sfWidgetFormInputText(),
      'pno_opr'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CreateOpr'), 'add_empty' => false)),
      'pno_status'  => new sfWidgetFormChoice(array('choices' => array('a' => 'a', 'p' => 'p', 'o' => 'o'))),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'acct_set_id' => new sfValidatorInteger(array('required' => false)),
      'pno_no'      => new sfValidatorString(array('max_length' => 45)),
      'pno_name'    => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'pno_desc'    => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'pno_fdesc'   => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'pno_uq'      => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'pno_minorq'  => new sfValidatorNumber(),
      'pno_maxorq'  => new sfValidatorNumber(),
      'pno_orq'     => new sfValidatorNumber(),
      'pno_src'     => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'pno_abc'     => new sfValidatorChoice(array('choices' => array(0 => 'a', 1 => 'b', 2 => 'c'), 'required' => false)),
      'pno_sfq'     => new sfValidatorNumber(),
      'pno_rop'     => new sfValidatorNumber(),
      'pno_eoq'     => new sfValidatorNumber(),
      'pno_pp'      => new sfValidatorChoice(array('choices' => array(0 => 'mrp', 1 => 'rop', 2 => 'oth'), 'required' => false)),
      'pno_bom'     => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'pno_opr'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CreateOpr'))),
      'pno_status'  => new sfValidatorChoice(array('choices' => array(0 => 'a', 1 => 'p', 2 => 'o'), 'required' => false)),
      'created_at'  => new sfValidatorDateTime(),
      'updated_at'  => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('mfg_pno[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'MfgPno';
  }

}
